home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2006 May / PCWMAY06.iso / Software / Freeware / First Page 2006 3.00 / fp2006-final-3.00-setup.exe / {app} / Iscripts / Date & Calendars / find-fri-13.izs < prev    next >
Text File  |  2005-09-27  |  9KB  |  470 lines

  1. <!NOWIZARD>
  2.  
  3. <!TITLE>Find Friday the 13th's!
  4. <!/TITLE>
  5.  
  6. <!DESCRIPTION>This clever script will find all the friday the 13th's within two given dates that you give.<!/DESCRIPTION> 
  7.  
  8. <!CATEGORY>calenders<!/CATEGORY>
  9.  
  10. <!SCRIPT>
  11. <!-- START OF SCRIPT -->
  12.  
  13. <!-- HOW TO INSTALL FIND FRIDAY THE 13TH'S!:
  14.  
  15.  
  16.  
  17.   1.  Copy the coding into the HEAD of your HTML document
  18.  
  19.   2.  Add the onLoad event handler into the BODY tag
  20.  
  21.   3.  Put the last coding into the BODY of your HTML document  -->
  22.  
  23.  
  24.  
  25. <!-- STEP ONE: Paste this code into the HEAD of your HTML document  -->
  26.  
  27.  
  28.  
  29. <HEAD>
  30.  
  31.  
  32.  
  33. <!-- Original:  Donnie Brewer (brewsky@cox.net ) -->
  34.  
  35. <!-- Web Site:  http://jscript.brewskynet.com/friday -->
  36.  
  37.     <style>
  38.  
  39.         #InternalDiv {position:relative;width:250px;height:1px;color:blue;background-color:#FDF5E6;border-style:double;border-color:blue;padding-top:5px;padding-left:5px;padding-right:5px;padding-bottom:5px;margin:3px;visibility:visible;z-index:10;top:50;left:0;}
  40.  
  41.     </style>
  42.  
  43.     <script>
  44.  
  45.     function startitup() {
  46.  
  47.         var BasicHTML = "<center>Results will be posted here!!</center>"
  48.  
  49.         document.all["InternalDiv"].innerHTML = BasicHTML;
  50.  
  51.         }
  52.  
  53.     </script>
  54.  
  55. </HEAD>
  56.  
  57.  
  58.  
  59. <!-- STEP TWO: Insert the onLoad event handler into your BODY tag  -->
  60.  
  61.  
  62.  
  63. <BODY onLoad="startitup()">
  64.  
  65.  
  66.  
  67. <!-- STEP THREE: Copy this code into the BODY of your HTML document  -->
  68.  
  69.  
  70. <!-- Original:  Donnie Brewer (brewsky@cox.net ) -->
  71.  
  72. <!-- Web Site:  http://jscript.brewskynet.com/friday -->
  73.  
  74. <script>
  75.  
  76.  
  77.  
  78. var new_Date=new Date()
  79.  
  80. //var DOW=new_Date.getDay()+1
  81.  
  82. var DOM=new_Date.getDate()
  83.  
  84. //var Month=new_Date.getMonth()+1
  85.  
  86. var Year=new_Date.getFullYear()
  87.  
  88. var LongMonth = new Array("January","February","March","April","May","June","July","August","September","October","November","December")
  89.  
  90. var LongDay = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")
  91.  
  92. var setTimer = 5000;
  93.  
  94.  
  95.  
  96. function find13th() {
  97.  
  98.     var Start = startyear.value
  99.  
  100.     var End = endyear.value
  101.  
  102.     var TooMuch = End-Start
  103.  
  104.     //alert(TooMuch)
  105.  
  106.     if (confirm("Caution, this may result in an extremely large result, and may take a long time to display those results."))
  107.  
  108.         if (End < Start)                        //if end<start alert user, else
  109.  
  110.             alert("Sorry, the ending year must be greater than or equal to the beginning year..")
  111.  
  112.         else {                                    //allow dates and continue
  113.  
  114.             var BasicHTML = "<center><u>Results!!</u>"
  115.  
  116.             for (YearTest=Start;YearTest<=End;YearTest++) {
  117.  
  118.                 if (MonthSelect.value==20) {
  119.  
  120.                     for (MonthTest=0;MonthTest<=11;MonthTest++) {
  121.  
  122.                         var TestDate = new Date(YearTest,MonthTest,13)
  123.  
  124.                         if (TestDate.getDay()==5)
  125.  
  126.                         BasicHTML = BasicHTML+"<br>"+LongMonth[MonthTest]+" "+TestDate.getDate()+", "+YearTest
  127.  
  128.                     }
  129.  
  130.                 }
  131.  
  132.                 else {
  133.  
  134.                     var TestDate = new Date(YearTest,MonthSelect.value,13)
  135.  
  136.                     if (TestDate.getDay()==5)
  137.  
  138.                     BasicHTML = BasicHTML+"<br>"+LongMonth[MonthSelect.value]+" "+TestDate.getDate()+", "+YearTest
  139.  
  140.                 }
  141.  
  142.             }
  143.  
  144.             document.all["InternalDiv"].innerHTML = BasicHTML;    
  145.  
  146.         }
  147.  
  148.     else {
  149.  
  150.         alert("Please make the years closer together..")
  151.  
  152.     }
  153.  
  154. }
  155.  
  156. function clearResults() {
  157.  
  158.     var BasicHTML = "<center>Results will be posted here!!</center>"
  159.  
  160.     document.all["InternalDiv"].innerHTML = BasicHTML;
  161.  
  162. }
  163.  
  164. </script>
  165.  
  166. <h1 style="font-size='24'">Find Friday the 13th's!!</h1>
  167.  
  168. Enter beginning year: 
  169.  
  170. <input type="Text" size="5" maxlength="4" name="startyear" value="2002">
  171.  
  172. <br><br>
  173.  
  174. Enter ending year: 
  175.  
  176. <input type="Text" size="5" maxlength="4" name="endyear" value="2002">
  177.  
  178.  
  179.  
  180. <br><br>
  181.  
  182. You may also select by a particular month: 
  183.  
  184.  
  185.  
  186. <select NAME="MonthSelect" size="1" style="HEIGHT: 22px; WIDTH: 130px">
  187.  
  188.     <option VALUE ="20" SELECTED>None Preferred</option>
  189.  
  190.     <option value="0">January</option>
  191.  
  192.     <option value="1">February</option>
  193.  
  194.     <option value="2">March</option>
  195.  
  196.     <option value="3">April</option>
  197.  
  198.     <option value="4">May</option>
  199.  
  200.     <option value="5">June</option>
  201.  
  202.     <option value="6">July</option>
  203.  
  204.     <option value="7">August</option>
  205.  
  206.     <option value="8">September</option>
  207.  
  208.     <option value="9">October</option>
  209.  
  210.     <option value="10">November</option>
  211.  
  212.     <option value="11">December</option>
  213.  
  214. </select>
  215.  
  216. <br><br>
  217.  
  218. <input type="Button" value="Find" onmouseup="find13th()">
  219.  
  220.     
  221.  
  222. <input type="Button" value="Clear Result List" onmouseup="clearResults()">
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232. <layer id="Layer1"><div id="InternalDiv"></div></layer><br><br><br><br>
  233.  
  234.  
  235.  
  236. <!-- END OF SCRIPT -->
  237. <!/SCRIPT>
  238.  
  239. <!PREVIEW>
  240. <!-- START OF SCRIPT -->
  241.  
  242. <!-- HOW TO INSTALL FIND FRIDAY THE 13TH'S!:
  243.  
  244.  
  245.  
  246.   1.  Copy the coding into the HEAD of your HTML document
  247.  
  248.   2.  Add the onLoad event handler into the BODY tag
  249.  
  250.   3.  Put the last coding into the BODY of your HTML document  -->
  251.  
  252.  
  253.  
  254. <!-- STEP ONE: Paste this code into the HEAD of your HTML document  -->
  255.  
  256.  
  257.  
  258. <HEAD>
  259.  
  260.  
  261.  
  262. <!-- Original:  Donnie Brewer (brewsky@cox.net ) -->
  263.  
  264. <!-- Web Site:  http://jscript.brewskynet.com/friday -->
  265.  
  266.     <style>
  267.  
  268.         #InternalDiv {position:relative;width:250px;height:1px;color:blue;background-color:#FDF5E6;border-style:double;border-color:blue;padding-top:5px;padding-left:5px;padding-right:5px;padding-bottom:5px;margin:3px;visibility:visible;z-index:10;top:50;left:0;}
  269.  
  270.     </style>
  271.  
  272.     <script>
  273.  
  274.     function startitup() {
  275.  
  276.         var BasicHTML = "<center>Results will be posted here!!</center>"
  277.  
  278.         document.all["InternalDiv"].innerHTML = BasicHTML;
  279.  
  280.         }
  281.  
  282.     </script>
  283.  
  284. </HEAD>
  285.  
  286.  
  287.  
  288. <!-- STEP TWO: Insert the onLoad event handler into your BODY tag  -->
  289.  
  290.  
  291.  
  292. <BODY onLoad="startitup()">
  293.  
  294.  
  295.  
  296. <!-- STEP THREE: Copy this code into the BODY of your HTML document  -->
  297.  
  298.  
  299. <!-- Original:  Donnie Brewer (brewsky@cox.net ) -->
  300.  
  301. <!-- Web Site:  http://jscript.brewskynet.com/friday -->
  302.  
  303. <script>
  304.  
  305.  
  306.  
  307. var new_Date=new Date()
  308.  
  309. //var DOW=new_Date.getDay()+1
  310.  
  311. var DOM=new_Date.getDate()
  312.  
  313. //var Month=new_Date.getMonth()+1
  314.  
  315. var Year=new_Date.getFullYear()
  316.  
  317. var LongMonth = new Array("January","February","March","April","May","June","July","August","September","October","November","December")
  318.  
  319. var LongDay = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")
  320.  
  321. var setTimer = 5000;
  322.  
  323.  
  324.  
  325. function find13th() {
  326.  
  327.     var Start = startyear.value
  328.  
  329.     var End = endyear.value
  330.  
  331.     var TooMuch = End-Start
  332.  
  333.     //alert(TooMuch)
  334.  
  335.     if (confirm("Caution, this may result in an extremely large result, and may take a long time to display those results."))
  336.  
  337.         if (End < Start)                        //if end<start alert user, else
  338.  
  339.             alert("Sorry, the ending year must be greater than or equal to the beginning year..")
  340.  
  341.         else {                                    //allow dates and continue
  342.  
  343.             var BasicHTML = "<center><u>Results!!</u>"
  344.  
  345.             for (YearTest=Start;YearTest<=End;YearTest++) {
  346.  
  347.                 if (MonthSelect.value==20) {
  348.  
  349.                     for (MonthTest=0;MonthTest<=11;MonthTest++) {
  350.  
  351.                         var TestDate = new Date(YearTest,MonthTest,13)
  352.  
  353.                         if (TestDate.getDay()==5)
  354.  
  355.                         BasicHTML = BasicHTML+"<br>"+LongMonth[MonthTest]+" "+TestDate.getDate()+", "+YearTest
  356.  
  357.                     }
  358.  
  359.                 }
  360.  
  361.                 else {
  362.  
  363.                     var TestDate = new Date(YearTest,MonthSelect.value,13)
  364.  
  365.                     if (TestDate.getDay()==5)
  366.  
  367.                     BasicHTML = BasicHTML+"<br>"+LongMonth[MonthSelect.value]+" "+TestDate.getDate()+", "+YearTest
  368.  
  369.                 }
  370.  
  371.             }
  372.  
  373.             document.all["InternalDiv"].innerHTML = BasicHTML;    
  374.  
  375.         }
  376.  
  377.     else {
  378.  
  379.         alert("Please make the years closer together..")
  380.  
  381.     }
  382.  
  383. }
  384.  
  385. function clearResults() {
  386.  
  387.     var BasicHTML = "<center>Results will be posted here!!</center>"
  388.  
  389.     document.all["InternalDiv"].innerHTML = BasicHTML;
  390.  
  391. }
  392.  
  393. </script>
  394.  
  395. <h1 style="font-size='24'">Find Friday the 13th's!!</h1>
  396.  
  397. Enter beginning year: 
  398.  
  399. <input type="Text" size="5" maxlength="4" name="startyear" value="2002">
  400.  
  401. <br><br>
  402.  
  403. Enter ending year: 
  404.  
  405. <input type="Text" size="5" maxlength="4" name="endyear" value="2002">
  406.  
  407.  
  408.  
  409. <br><br>
  410.  
  411. You may also select by a particular month: 
  412.  
  413.  
  414.  
  415. <select NAME="MonthSelect" size="1" style="HEIGHT: 22px; WIDTH: 130px">
  416.  
  417.     <option VALUE ="20" SELECTED>None Preferred</option>
  418.  
  419.     <option value="0">January</option>
  420.  
  421.     <option value="1">February</option>
  422.  
  423.     <option value="2">March</option>
  424.  
  425.     <option value="3">April</option>
  426.  
  427.     <option value="4">May</option>
  428.  
  429.     <option value="5">June</option>
  430.  
  431.     <option value="6">July</option>
  432.  
  433.     <option value="7">August</option>
  434.  
  435.     <option value="8">September</option>
  436.  
  437.     <option value="9">October</option>
  438.  
  439.     <option value="10">November</option>
  440.  
  441.     <option value="11">December</option>
  442.  
  443. </select>
  444.  
  445. <br><br>
  446.  
  447. <input type="Button" value="Find" onmouseup="find13th()">
  448.  
  449.     
  450.  
  451. <input type="Button" value="Clear Result List" onmouseup="clearResults()">
  452.  
  453.  
  454.  
  455.  
  456.  
  457.  
  458.  
  459.  
  460.  
  461. <layer id="Layer1"><div id="InternalDiv"></div></layer><br><br><br><br>
  462.  
  463.  
  464.  
  465.  
  466.  
  467. <!-- END OF SCRIPT -->
  468. <!/PREVIEW>
  469.  
  470. <!RELATED>NONE<!/RELATED>